package com.darrenchan.leetcode;

/**
 * @Desc
 * @Author chenchi03
 * @CreateTime 2020-01-22 17:50
 */
public class Q674 {
    public int findLengthOfLCIS(int[] nums) {
        if (nums == null || nums.length == 0) {
            return 0;
        }

        int len = nums.length;
        int[] dp = new int[len];
        int max = 0;

        for (int i = 0; i < len; i++) {
            dp[i] = 1;

            if(i > 0 && nums[i - 1] < nums[i]){
                dp[i] = Math.max(dp[i], dp[i - 1] + 1);
            }

            if(max < dp[i]){
                max = dp[i];
            }
        }

        return max;
    }
}
